package kk.learn.rabbitmq.dlxdemo.model;

/**
 * <p>
 *
 * </p>
 *
 * @author KK
 * @since 2021-10-30
 */
public class Result {


    private String errCode;

    private String errMsg;

    private Object data;


    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }


    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }



    public static Result ok(Object data) {
        Result result = new Result();
        result.setErrCode("200");
        result.setErrMsg("OK");
        result.setData(data);
        return result;
    }

    public static Result ok() {
        return ok(null);
    }


    public static Result error(String errCode,String errMsg) {
        Result result = new Result();
        result.setErrCode(errCode);
        result.setErrMsg(errMsg);
        return result;
    }

}


